﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class EnemyManager : MonoBehaviour
{

    public List<EnemyInBattle> allEnemyInBattle;

    public List<GameObject> allEnemyGameObject;
    // Use this for initialization
    void Start()
    {
        BattleCreateManager.Instance.CreatEnemyByPrefabNameList();
    }

    IEnumerator FindEnemyAnd_SetEnemyInBattleData()
    {
        yield return new WaitForSeconds(0.2f);
        allEnemyInBattle = new List<EnemyInBattle>();

        allEnemyGameObject = new List<GameObject>();
        allEnemyGameObject.AddRange(GameObject.FindGameObjectsWithTag("Enemy"));

        yield return new WaitForSeconds(0.3f);
        foreach(  GameObject   e  in allEnemyGameObject)
        {
            allEnemyInBattle.Add(e.GetComponent<EnemyInBattle>());
        }


    }

    // Update is called once per frame
    void Update()
    {

    }
}
